// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {
    AddPrintInput,
    DeletePrintInput,
    PagePrintInput,
    UpdatePrintInput,
} from '../models';
// 定义 API 路径枚举
enum Api {
    SysPrintAdd = '/sysPrint/add',
    SysPrintDelete = '/sysPrint/delete',
    SysPrintPage = '/sysPrint/page',
    SysPrintPrintName = '/sysPrint/print/{name}',
    SysPrintUpdate = '/sysPrint/update',
}

// 定义 API 方法
export const apiSysPrintAddPost = (body?: AddPrintInput) =>
    request({
        url: Api.SysPrintAdd,
        method: 'post',
        data: body,
    });

export const apiSysPrintDeletePost = (body?: DeletePrintInput) =>
    request({
        url: Api.SysPrintDelete,
        method: 'post',
        data: body,
    });

export const apiSysPrintPagePost = (body?: PagePrintInput) =>
    request({
        url: Api.SysPrintPage,
        method: 'post',
        data: body,
    });

export const apiSysPrintPrintNameGet = (name: string) =>
    request({
        url: Api.SysPrintPrintName.replace('{name}', name),
        method: 'get',
    });

export const apiSysPrintUpdatePost = (body?: UpdatePrintInput) =>
    request({
        url: Api.SysPrintUpdate,
        method: 'post',
        data: body,
    });